package com.jk.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 周慧茹
 * 创建时间 2018/4/16  11:51
 * 邮箱 960297232@qq.com
 */
public class   Cookie {

      public    String   getCookie(HttpServletRequest request) {

          javax.servlet.http.Cookie[] cookies = request.getCookies();//这样便可以获取一个cookie数组
          String cookieid = null;
          if (null == cookies) {
              System.out.println("没有cookie=========");
          } else {
              for (javax.servlet.http.Cookie cookie : cookies) {

                  cookieid = cookie.getValue();
              }



          }
          return cookieid;
      }

}
